local Car
do
  local _base_0 = {
    choose = function(self, t)
      self.specification = t
      print("Dear Customer:")
      print("Your choose " .. tostring(self.specification['brand']))
      return print("---------------------------")
    end,
    produce = function(self)
      print("Start producing car for you")
      print("Here is your specifications:")
      print("---------------------------")
      for k, v in pairs(self.specification) do
        print(k, v)
      end
    end
  }
  _base_0.__index = _base_0
  local _class_0 = setmetatable({
    __init = function(self)
      self.specification = { }
    end,
    __base = _base_0,
    __name = "Car"
  }, {
    __index = _base_0,
    __call = function(cls, ...)
      local _self_0 = setmetatable({}, _base_0)
      cls.__init(_self_0, ...)
      return _self_0
    end
  })
  _base_0.__class = _class_0
  Car = _class_0
end
local Person
do
  local _base_0 = {
    grow = function(self)
      self.age = self.age + 1
    end,
    buy = function(self, v)
      print("Hello!" .. self.name)
      return print("Wow, you got something")
    end
  }
  _base_0.__index = _base_0
  local _class_0 = setmetatable({
    __init = function(self)
      self.name = ""
      self.age = 0
    end,
    __base = _base_0,
    __name = "Person"
  }, {
    __index = _base_0,
    __call = function(cls, ...)
      local _self_0 = setmetatable({}, _base_0)
      cls.__init(_self_0, ...)
      return _self_0
    end
  })
  _base_0.__class = _class_0
  Person = _class_0
end
local Inventory
do
  local _base_0 = {
    add_item_by_name = function(self, name)
      if self.items[name] then
        self.items[name] = self.items[name] + 1
      else
        self.items[name] = 1
      end
    end,
    add_item_by_index = function(self, t)
      local index = #self.items + 1
      self.items[index] = t
    end
  }
  _base_0.__index = _base_0
  local _class_0 = setmetatable({
    __init = function(self)
      self.items = { }
    end,
    __base = _base_0,
    __name = "Inventory"
  }, {
    __index = _base_0,
    __call = function(cls, ...)
      local _self_0 = setmetatable({}, _base_0)
      cls.__init(_self_0, ...)
      return _self_0
    end
  })
  _base_0.__class = _class_0
  Inventory = _class_0
end
local my_specification = {
  brand = "BMW",
  price = 40000,
  length = 40,
  heigth = 2
}
local buycar
buycar = function()
  local mycar = Car()
  mycar:choose(my_specification)
  local myinv = Inventory()
  myinv:add_item_by_index(mycar)
  for i, v in pairs(myinv.items) do
    v:produce()
  end
end
local xingwenju = Person()
xingwenju.name = "xing wenju"
xingwenju:buy("a car")
print("Welcome to Car selling system!")
return buycar()
